package com.yanjiali.mappers;

import com.yanjiali.entity.Article;
import com.yanjiali.model.resp.GetByIdArticleResp;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;

import java.util.List;

/**
 * @Package: com.yanjiali.mappers
 * @Author: yanjiali
 * @Created: 2025/4/17 15:36
 */
@Mapper(componentModel = "spring")
public interface GetByIdArticleRespMapper {

    GetByIdArticleRespMapper INSTANCE = Mappers.getMapper(GetByIdArticleRespMapper.class);

    /**
     * entity --> vo
     * @param article
     * @return
     */
    GetByIdArticleResp entity2Resp(Article article);

    /**
     * 批量 entity --> vo
     * @param articles
     * @return
     */
    List<GetByIdArticleResp> entityALL2Resp(List<Article> articles);
}
